//
//  PhotobrowseCell.m
//  宜居HD
//
//  Created by 张金国 on 16/5/4.
//  Copyright © 2016年 张金国. All rights reserved.
//

#import "PhotobrowseCell.h"
#import "Masonry.h"


@implementation PhotobrowseCell

#pragma mark - init
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.contentView.backgroundColor = [UIColor redColor];
        [self setupConstraints];
    }
    return self;
}

#pragma mark - private
- (void)setupConstraints {
    [self.photo mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_top).offset(FiveOffsetViewMargin);
        make.left.equalTo(self.mas_left).offset(FiveOffsetViewMargin);
        make.bottom.equalTo(self.mas_bottom).offset(-FiveOffsetViewMargin);
        make.right.equalTo(self.mas_right).offset(-FiveOffsetViewMargin);
    }];
}

#pragma mark - Getter
- (UIImageView *)photo {
    if (!_photo) {
        _photo = [[UIImageView alloc]init];
        _photo.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:self.photo];
    }
    return _photo;
}

@end
